package com.zero.basic.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class SimpleDateUtil {

	private static SimpleDateFormat simpleDF;

	static {
		simpleDF = new SimpleDateFormat("yyyy-MM");
	}

	public static void setFormat(String format) {
		simpleDF.applyPattern(format);
	}

	public static Date parseDate(String date) throws ParseException {
		return simpleDF.parse(date);
	}

	public static String generateDateString(Date date) {
		return simpleDF.format(date);
	}
	
	public static String getCurrentYear() {
		return new SimpleDateFormat("yyyy").format(new Date());
	}
}
